module AdminHelper

  def sortable(column, title = nil)
    title ||= column.titleize
    css_class = column == sort_column ? "current #{sort_direction}" : "sorting"
    direction = column == sort_column && sort_direction == "asc" ? "desc" : "asc"
    content_tag(:th, (link_to title, params.merge({:sort => column, :direction => direction})), :class => css_class)
  end

  def beautiful_time(time)
    time.stamp("2013-03-12 22:01:22")
  end

  def beautiful_date(time)
    time.stamp("2013-03-12")
  end

end
